import {
  PanelController,
  IPanelItemProvider,
  PanelItemController,
} from '@ibiz-template/runtime';
import { IPanelItem } from '@ibiz/model-core';
import { PanelDraggableContainerController } from './panel-draggable-container.controller';

/**
 * @description 面板可拖拽容器适配器
 * @export
 * @class PanelDraggableContainerProvider
 * @implements {IPanelItemProvider}
 */
export class PanelDraggableContainerProvider implements IPanelItemProvider {
  component: string = 'IBizPanelDraggableContainer';

  async createController(
    panelItem: IPanelItem,
    panel: PanelController,
    parent: PanelItemController | undefined,
  ): Promise<PanelDraggableContainerController> {
    const c = new PanelDraggableContainerController(panelItem, panel, parent);
    await c.init();
    return c;
  }
}
